/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package medialibrary.persistence;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 *
 * @author user
 */
@Entity
@Table(name = "order")

public class Ordre implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "orderNr")
    private Integer orderNr;
    @JoinColumn(name = "oeuvreISBN", referencedColumnName = "oeuvreISBN")
    @ManyToOne(optional = false)
    private Oeuvre oeuvreISBN;
    @JoinColumn(name = "administratorId", referencedColumnName = "administratorId")
    @ManyToOne(optional = false)
    private Administrator administratorId;
    @JoinColumn(name = "providerId", referencedColumnName = "providerId")
    @ManyToOne(optional = false)
    private Provider providerId;

    public Ordre() {
    }

    public Ordre(Integer orderNr) {
        this.orderNr = orderNr;
    }

    public Integer getOrderNr() {
        return orderNr;
    }

    public void setOrderNr(Integer orderNr) {
        this.orderNr = orderNr;
    }

    public Oeuvre getOeuvreISBN() {
        return oeuvreISBN;
    }

    public void setOeuvreISBN(Oeuvre oeuvreISBN) {
        this.oeuvreISBN = oeuvreISBN;
    }

    public Administrator getAdministratorId() {
        return administratorId;
    }

    public void setAdministratorId(Administrator administratorId) {
        this.administratorId = administratorId;
    }

    public Provider getProviderId() {
        return providerId;
    }

    public void setProviderId(Provider providerId) {
        this.providerId = providerId;
    }

    public String toString() {
        return orderNr + "";
    }
    
}
